/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cx1.service.api;

import java.util.Date;
import java.util.List;
import org.cx1.model.Listing;
import org.cx1.model.utils.SearchOption;
import org.cx1.model.utils.ServiceResponse;

/**
 *
 * @author ECH
 */
public interface IListingService {
    
    public ServiceResponse<List<Listing>> readAll(int offset, int limit);
   
    public ServiceResponse<Listing> read(String id);    
    
    public ServiceResponse<String> create(Listing listing);
          
    public ServiceResponse<String> create(Listing listing, boolean verified, boolean available, boolean posted);
    
    public ServiceResponse<Boolean> update(Listing listing);
         
    public ServiceResponse<Boolean> delete(String id);
    
    public ServiceResponse<Boolean> delete(String listingID, String userID);
        
    public ServiceResponse<Listing> readByRoomoramaID(String id);
        
    public ServiceResponse<List<Listing>> readAllVerified(int offset, int limit, boolean verified);
    
    public ServiceResponse<List<Listing>> readAllPosted(int offset, int limit, boolean posted);
    
    public ServiceResponse<List<Listing>> readAllPosted(int offset, int limit, boolean posted, int leaseTerm);    
    
    public ServiceResponse<List<Listing>> readAllRoomorama(int offset, int limit);
    
    public ServiceResponse<List<Listing>> readUserListings(String userID, int offset, int limit);
    
    public ServiceResponse<List<Listing>> readPlaceListings(String placeID, int offser, int limit);
    
    public ServiceResponse<List<Listing>> readPlaceListings(String placeID, int offser, int limit, int leaseTerm);
    
    public ServiceResponse<List<Listing>> readPlaceListingsRoomorama(String placeID, int offser, int limit);
        
    public ServiceResponse<List<Listing>> readShortTermListings(int offset, int limit);
    
    public ServiceResponse<List<Listing>> readLongTermListings(int offset, int limit);
    
    public ServiceResponse<List<Listing>> readRoomoramaListings(int offset, int limit);
    
    public ServiceResponse<Boolean> setAvailability(String id, boolean available);
    
    public ServiceResponse<Boolean> postListing(String id);
    
    public ServiceResponse<Boolean> unpostListing(String id);
    
    public ServiceResponse<Boolean> verify(String id, boolean verified);
    
    public ServiceResponse<Boolean> setPenalized(String id, boolean penalize);
                
    public ServiceResponse<Boolean> incrementImpressions(String id);
    
    public ServiceResponse<Boolean> incrementViews(String id);
        
    public ServiceResponse<Boolean> clearShortTermListings();
    
    public ServiceResponse<Boolean> clearLongTermListings();
    
    public ServiceResponse<Boolean> clearRoomoramaListings();
            
    public ServiceResponse<Integer> countFiltered(SearchOption searchOption);
    
    public ServiceResponse<List<Listing>> readFiltered(SearchOption searchOption);
    
    public ServiceResponse<List<Listing>> readFilteredVerified(SearchOption searchOption);
    
}
